home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / Table / Sources / Proxy.h < prev    next >
Encoding:
Text File  |  1996-04-25  |  4.5 KB  |  152 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Proxy.h
  4. //    Release Version:    $ ODF 1 $ 
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef PROXY_H
  11. #define PROXY_H
  12.  
  13. #ifndef PART_H
  14. #include "Part.h"
  15. #endif
  16.  
  17. #ifndef CELL_H
  18. #include "Cell.h"
  19. #endif
  20.  
  21. // ----- ODF Includes -----
  22.  
  23. #ifndef FWPROXY_H
  24. #include "FWProxy.h"
  25. #endif
  26.  
  27. // ----- Foundation Layer -----
  28.  
  29. #ifndef FWRUNTYP_H
  30. #include "FWRunTyp.h"
  31. #endif
  32.  
  33. #ifndef FWTCOLL_H
  34. #include "FWTColl.h"
  35. #endif
  36.  
  37. //========================================================================================
  38. //    Forward declarations
  39. //========================================================================================
  40.  
  41. class CTablePart;
  42. class CTableContent;
  43.  
  44. //========================================================================================
  45. //    class CTableProxy
  46. //========================================================================================
  47.  
  48. class CTableProxy : public FW_MProxy
  49. {
  50. public:
  51.  
  52. //----------------------------------------------------------------------------------------
  53. //    Initialization/Destruction
  54. //
  55.   public:
  56.     CTableProxy(Environment* ev, CTablePart* tablePart, CTableContent* content, FW_CPresentation* presentation);
  57.     virtual ~ CTableProxy();
  58.  
  59. //----------------------------------------------------------------------------------------
  60. //    Inherited API
  61. //
  62.     virtual void         UsedShapeChanged(Environment *ev,
  63.                                       FW_CEmbeddingFrame* embeddingFrame,
  64.                                       ODFrame* odEmbeddedFrame);
  65.  
  66.     virtual ODShape*     FrameShapeRequested(Environment* ev, 
  67.                                     FW_CEmbeddingFrame* embeddingFrame, 
  68.                                     ODFrame* odEmbeddedFrame, 
  69.                                     ODShape* askedFrameShape);
  70.  
  71.     virtual void        OpenInWindow(Environment* ev, FW_CProxyFrame* proxyFrame);
  72.  
  73. //----------------------------------------------------------------------------------------
  74. //    New API
  75. //
  76.   public:
  77.     void                MoveEmbeddedFrames(Environment* ev, const CCell& destCell);
  78.     ODShape*            AcquireHiliteShape(Environment* ev, const CCell& cell, FW_CEmbeddingFrame* frame);
  79.  
  80.     // ----- Getters/Setters -----
  81.     const CCell&         GetCell() const;
  82.     void                SetCell(const CCell& cell);    
  83.     
  84.     void                Selected(FW_Boolean state);
  85.     
  86. //----------------------------------------------------------------------------------------
  87. //    Data Members
  88. //
  89.   protected:
  90.     CTablePart*        fTablePart;
  91.     CTableContent*    fTableContent;
  92.     CCell            fCell;
  93.     FW_Boolean        fSelected;
  94. };
  95.  
  96. //========================================================================================
  97. // class CTableProxyCollection
  98. //========================================================================================
  99.  
  100. class CTableProxyCollection : public FW_TOrderedCollection<CTableProxy>
  101. {
  102. public:
  103.     FW_DECLARE_AUTO(CTableProxyCollection)
  104.     
  105.     CTableProxyCollection() :
  106.         FW_TOrderedCollection<CTableProxy>(){}
  107.     ~CTableProxyCollection() {}
  108. };
  109.  
  110. //========================================================================================
  111. // class CTableProxyCollectionIterator
  112. //========================================================================================
  113.  
  114. class CTableProxyCollectionIterator : public FW_TOrderedCollectionIterator<CTableProxy>
  115. {
  116. public:
  117.     FW_DECLARE_AUTO(CTableProxyCollectionIterator)
  118.     
  119.     CTableProxyCollectionIterator(CTableProxyCollection* collection) :
  120.         FW_TOrderedCollectionIterator<CTableProxy>(collection){}
  121.     ~CTableProxyCollectionIterator() {}
  122. };
  123.  
  124. //========================================================================================
  125. //    CTableProxy Inlines
  126. //========================================================================================
  127.  
  128. //----------------------------------------------------------------------------------------
  129. //    CTableProxy::GetCell
  130. //----------------------------------------------------------------------------------------
  131. inline const CCell& CTableProxy::GetCell() const
  132. {
  133.     return fCell;
  134. }
  135. //----------------------------------------------------------------------------------------
  136. //    CTableProxy::Selected
  137. //----------------------------------------------------------------------------------------
  138. inline void CTableProxy::Selected(FW_Boolean state)
  139. {
  140.     fSelected = state;
  141. }
  142.  
  143. //----------------------------------------------------------------------------------------
  144. //    CTableProxy::SetCell
  145. //----------------------------------------------------------------------------------------
  146. inline void CTableProxy::SetCell(const CCell& cell)
  147. {
  148.     fCell = cell;
  149. }
  150.  
  151. #endif
  152.